package com.ruoyi.project.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.common.core.domain.FinBaseEntity;
import com.ruoyi.common.domainenum.FinSubjectDirectionType;
import com.ruoyi.common.domainenum.FinSubjectMoneyType;
import com.ruoyi.common.domainenum.FinSubjectStatus;
import com.ruoyi.common.domainenum.FinSubjectType;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.List;

/**
 * 科目对象 fin_subject
 * 
 * @author abel
 * @date 2024-10-15
 */
public class FinSubject extends FinBaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 上级科目id */
    @Excel(name = "上级科目id")
    private Long parentId;

    private Integer subjectLevel;

    /** 上级科目 */
    @Excel(name = "上级科目")
    private String parentName;

    private String parentCode;

    @Excel(name = "拼音首字母")
    private String pinYinFirst;

    private FinSubjectMoneyType moneyType;

    /** 类型 */
    @Excel(name = "类型")
    private FinSubjectType subjectType;

    /** 状态 */
    @Excel(name = "状态")
    private FinSubjectStatus status;

    /**
     * 系统默认科目不能删除
     */
    private Boolean hasDefault;

    /** 编码
     * 级次说明： 0001 001 001 01 01
     * */
    @Excel(name = "编码")
    private String code;

    /** 名称 */
    @Excel(name = "名称")
    private String name;

    /** 借贷方向 */
    @Excel(name = "借贷方向")
    private FinSubjectDirectionType directionType;

    @TableField(exist = false)
    private List<FinSubject> children;

    @TableField(exist = false)
    private Boolean hasChildren;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public Integer getSubjectLevel() {
        return subjectLevel;
    }

    public void setSubjectLevel(Integer subjectLevel) {
        this.subjectLevel = subjectLevel;
    }

    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    public Boolean getHasDefault() {
        return hasDefault;
    }

    public void setHasDefault(Boolean hasDefault) {
        this.hasDefault = hasDefault;
    }

    public Boolean getHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(Boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    public List<FinSubject> getChildren() {
        return children;
    }

    public void setChildren(List<FinSubject> children) {
        this.children = children;
    }

    public FinSubjectMoneyType getMoneyType() {
        return moneyType;
    }

    public void setMoneyType(FinSubjectMoneyType moneyType) {
        this.moneyType = moneyType;
    }

    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public Long getParentId() 
    {
        return parentId;
    }
    public void setParentName(String parentName) 
    {
        this.parentName = parentName;
    }

    public String getParentName() 
    {
        return parentName;
    }

    public FinSubjectType getSubjectType() {
        return subjectType;
    }

    public void setSubjectType(FinSubjectType subjectType) {
        this.subjectType = subjectType;
    }

    public FinSubjectStatus getStatus() {
        return status;
    }

    public void setStatus(FinSubjectStatus status) {
        this.status = status;
    }

    public void setCode(String code)
    {
        this.code = code;
    }

    public String getPinYinFirst() {
        return pinYinFirst;
    }

    public void setPinYinFirst(String pinYinFirst) {
        this.pinYinFirst = pinYinFirst;
    }

    public String getCode()
    {
        return code;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }

    public FinSubjectDirectionType getDirectionType() {
        return directionType;
    }

    public void setDirectionType(FinSubjectDirectionType directionType) {
        this.directionType = directionType;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("parentId", getParentId())
            .append("parentName", getParentName())
            .append("subjectType", getSubjectType())
            .append("status", getStatus())
            .append("code", getCode())
            .append("name", getName())
            .append("directionType", getDirectionType())
            .append("packageId", getPackageId())
            .append("createId", getCreateId())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateId", getUpdateId())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
